package com.scut.edu.wanyou.more;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.scut.edu.wanyou.PublishActivity;
import com.scut.edu.wanyou.R;
import com.scut.edu.wanyou.conf.Config;
import com.scut.edu.wanyou.util.UserKeeper;
import com.scut.edu.wanyou.util.UserToken;
import com.scut.edu.wanyou.widget.TextImageView;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class MoreActivity extends Activity implements OnClickListener{
	
	private ListView listView = null;
    private TextView mTitleView;
    private Button publish = null;
    private TextView profile_edit = null;
    
    private TextView profile_username = null;
    
    private List<Pair<Integer, Integer>> viewList = new ArrayList<Pair<Integer,Integer>>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.more_activity);
        prepareView();
        mTitleView.setText(R.string.category_more);
        
        UserToken token = UserKeeper.readUserToken(getApplicationContext());
        profile_username.setText(token.getUsername());
    }

    private void prepareView() {
        mTitleView = (TextView) findViewById(R.id.title_text);
        publish = (Button)findViewById(R.id.act_publish);
        publish.setOnClickListener(this);
        
        profile_edit = (TextView)findViewById(R.id.profile_edit);
        profile_edit.setOnClickListener(this);
        
        profile_username = (TextView)findViewById(R.id.profile_username);
    }
    
    private OnItemClickListener listener = new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
				long arg3) {
			// TODO Auto-generated method stub
			Toast.makeText(getApplicationContext(), ""+viewList.get(arg2).first, Toast.LENGTH_SHORT).show();
		}
    	
	};
 
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.act_publish:
			Intent intent = new Intent(MoreActivity.this,PublishActivity.class);
			startActivity(intent);
			break;
		case R.id.profile_edit:
			
			break;
		default:
			break;
		}
	}
}
